import React, {Component} from 'react';
import Konva from 'konva';
import {render} from 'react-dom';
import {Stage, Layer, Image} from 'react-konva';

class GraphicsImg extends Component {
    state = {
        image: null
    };

    componentDidMount() {
        const image = new window.Image();
        image.src = 'http://img2.imgtn.bdimg.com/it/u=2324142732,2582917806&fm=26&gp=0.jpg';
        image.onload = () => {
            this.setState({
                image: image
            });
        };
    }
    render() {
        return (
            <Stage width={300} height={500}
            >
                <Layer>
                    <Image image={this.state.image}/>
                </Layer>
            </Stage>
        );
    }
}

export default GraphicsImg;